/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package virtual.BD;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Rafael
 */
@Entity
@Table(name = "professor")
@NamedQueries({
    @NamedQuery(name = "Professor.findAll", query = "SELECT p FROM Professor p"),
    @NamedQuery(name = "Professor.findByCdProfessor", query = "SELECT p FROM Professor p WHERE p.cdProfessor = :cdProfessor"),
    @NamedQuery(name = "Professor.findByDsFormacao", query = "SELECT p FROM Professor p WHERE p.dsFormacao = :dsFormacao"),
    @NamedQuery(name = "Professor.findByNuMatricula", query = "SELECT p FROM Professor p WHERE p.nuMatricula = :nuMatricula"),
    @NamedQuery(name = "Professor.findByQtHorasAlocadas", query = "SELECT p FROM Professor p WHERE p.qtHorasAlocadas = :qtHorasAlocadas")})
public class Professor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cd_professor")
    private Integer cdProfessor;
    @Column(name = "ds_formacao")
    private String dsFormacao;
    @Column(name = "nu_matricula")
    private String nuMatricula;
    @Column(name = "qt_horas_alocadas")
    private Double qtHorasAlocadas;

    public Professor() {
    }

    public Professor(Integer cdProfessor) {
        this.cdProfessor = cdProfessor;
    }

    public Integer getCdProfessor() {
        return cdProfessor;
    }

    public void setCdProfessor(Integer cdProfessor) {
        this.cdProfessor = cdProfessor;
    }

    public String getDsFormacao() {
        return dsFormacao;
    }

    public void setDsFormacao(String dsFormacao) {
        this.dsFormacao = dsFormacao;
    }

    public String getNuMatricula() {
        return nuMatricula;
    }

    public void setNuMatricula(String nuMatricula) {
        this.nuMatricula = nuMatricula;
    }

    public Double getQtHorasAlocadas() {
        return qtHorasAlocadas;
    }

    public void setQtHorasAlocadas(Double qtHorasAlocadas) {
        this.qtHorasAlocadas = qtHorasAlocadas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdProfessor != null ? cdProfessor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Professor)) {
            return false;
        }
        Professor other = (Professor) object;
        if ((this.cdProfessor == null && other.cdProfessor != null) || (this.cdProfessor != null && !this.cdProfessor.equals(other.cdProfessor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "virtual.BD.Professor[cdProfessor=" + cdProfessor + "]";
    }

}
